<?php

use Illuminate\Routing\Router;


Route::group([
    'prefix'        => config('admin.route.prefix'),
//    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', function (){
        return redirect('/admin/task');
    });
    $router->get('/ad-task/sync', 'App\Admin\Controllers\AdTaskController@sync');
    $router->get('/ad-task/clear', 'App\Admin\Controllers\AdTaskController@clear');
    $router->get('/task/sync', 'App\Admin\Controllers\TaskController@sync');
    $router->get('/task/clear', 'App\Admin\Controllers\TaskController@clear');
    $router->resource('/task','App\Admin\Controllers\TaskController');
    $router->resource('/rate-type','App\Admin\Controllers\RateTypeController')->name('index','rate-type');
    $router->resource('/ad-task','App\Admin\Controllers\AdTaskController');

    $router->get('/settings/sync', 'App\Admin\Controllers\ConfigController@sync');
    $router->resource('/settings', 'App\Admin\Controllers\ConfigController');

});

Admin::registerAuthRoutes();
